﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;
using System.Xml.Serialization;

namespace uTorrentNetClient.ModelDesign.Helper
{
    public class AppSetting : Base
    {
        public AppSetting()
        {
            RefreshSec = 10;
            ShowNotifyWindow = true;
        }

        private string _server;
        public string Server 
        {
            get { return _server; } 
            set 
            {
                setHasChanges(_server, value);
                _server = value;
                SetNotifyPropertyChanged("Server");
            }
        }

        private int _port;
        public int Port
        {
            get { return _port; }
            set
            {
                setHasChanges(_port, value);
                _port = value;
                SetNotifyPropertyChanged("Port");
            }
        }

        private string _user;
        public string User
        {
            get { return _user; }
            set
            {
                setHasChanges(_user, value);
                _user = value;
                SetNotifyPropertyChanged("User");
            }
        }

        private string _password;
        public string Password
        {
            get { return _password; }
            set
            {
                setHasChanges(_password, value);
                _password = value;
                SetNotifyPropertyChanged("Password");
            }
        }

        private int _refreshSec;
        public int RefreshSec
        {
            get { return _refreshSec; }
            set
            {
                setHasChanges(_refreshSec, value);
                _refreshSec = value;
                SetNotifyPropertyChanged("RefreshSec");
            }
        }

        private bool _showNotifyWindow;
        public bool ShowNotifyWindow
        {
            get { return _showNotifyWindow; }
            set
            {
                setHasChanges(_showNotifyWindow, value);
                _showNotifyWindow = value;
                SetNotifyPropertyChanged("ShowNotifyWindow");
            }
        }

        private bool _showDialogOnNewTorrent;
        public bool ShowDialogOnNewTorrent
        {
            get { return _showDialogOnNewTorrent; }
            set
            {
                setHasChanges(_showDialogOnNewTorrent, value);
                _showDialogOnNewTorrent = value;
                SetNotifyPropertyChanged("ShowDialogOnNewTorrent");
            }
        }
    }
}
